Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1179 Deprecated SPDX license #1263

Merged
merged 3 commits into from
Oct 14, 2022
Merged

Fixes #1179 Deprecated SPDX license #1263

merged 3 commits into from
Oct 14, 2022

Conversation

vargenau
Copy link
Contributor

Fixes #1179 Deprecated SPDX license (GFDL* and BSD-2-Clause-NetBSD)

Signed-off-by: Marc-Etienne Vargenau [email protected]

Fixes #1179 Deprecated SPDX license (GFDL* and BSD-2-Clause-NetBSD)

Signed-off-by: Marc-Etienne Vargenau <[email protected]>
@kzantow
Copy link
Contributor

kzantow commented Oct 14, 2022

Hi @vargenau, I made a bit of a change to this PR and regenerated the license list -- could you have a look through the result and confirm it is what you are expecting?

Thanks!

Signed-off-by: Keith Zantow <[email protected]>
Copy link
Contributor

@spiffcs spiffcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just quick clarification comment -thanks @vargenau for the PR and @kzantow for the follow up here!

"abc-1-or-later": "ABC-1.0-Or-later",
"abc-1.0-or-later": "ABC-1.0-Or-later",
"abc-1.0.0-or-later": "ABC-1.0-Or-later",
"abc-1": "ABC-1.0-only",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that the casing has changed here, but just wanted to confirm for others who come across this that these are correct as of 3.18:

https://spdx.org/licenses/ <-- "or" and "only" are lower cased here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe these should be lower cased. I don't see any license with upper case variants.

@@ -43,7 +60,7 @@ func (l License) canReplace(other License) bool {
}
}

return l.ID != other.ID
return l.ID == other.ID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we have to flip this here? I admit it's a little hard to reason about this case since it's the last one checked with so many other chances of an early return

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the look @spiffcs -- this function is canReplace, I think we haven't seen this bug because the other negative test conditions failed first. Basically: this function is trying to find any license that could be replaced by another license by checking equality in almost all the other fields. However, when it gets to the end here, the condition previously here is "if the ID is NOT the same, we can consider it equal". Two comments about this: 1) this is not ever triggered based on the current document, and 2) I really don't think this is right -- if at the end of all the checks, the IDs are the same, it would return false... which means maybe we have different Text...

@kzantow kzantow merged commit 41bc6bb into anchore:main Oct 14, 2022
@vargenau
Copy link
Contributor Author

Thank you all for accepting and improving my patch.

I confirm it works as expected for me.

Can you also have a look at at pull request #1259 ? Thank you

@vargenau vargenau deleted the patch-1 branch October 15, 2022 11:21
@vargenau
Copy link
Contributor Author

Please check also pull request #1266 One more deprecated SPDX license: StandardML-NJ

aiwantaozi pushed a commit to aiwantaozi/syft that referenced this pull request Oct 20, 2022
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Deprecated SPDX license (GFDL* and BSD-2-Clause-NetBSD)
3 participants